package PTA;

import java.util.Scanner;

public class Pta12 {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        int n= sc.nextInt();
        if (n>0&&n<15){
            String ret =Integer.toString(n,16);
            System.out.println(ret.toUpperCase());
        }else {
            System.out.println("Invalid input");
        }
    }
}
